// 引入底部导航栏组件
import {
  Form,
  Tabbar,
  TabbarItem,
  Field,
  Button,
  Popup,
  Toast,
  NavBar,
  Uploader,
  Cell,
  Image as VanImage,
  Lazyload,
  DatetimePicker,
  ActionSheet,
  AddressList,
  Empty,
  AddressEdit,
  Icon,
  Search,
  Swipe,
  SwipeItem,
  Loading,
  PullRefresh,
  List,
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Tag,
  Stepper,
  Checkbox,
  SubmitBar,
  Tabs,
  Tab,
  Sidebar,
  SidebarItem
} from 'vant'

// 定义数组来保存所有需要用到的组件
const VantList = [
  Tabbar,
  TabbarItem,
  Form,
  Field,
  Button,
  Popup,
  Toast,
  NavBar,
  Uploader,
  Cell,
  VanImage,
  Lazyload,
  DatetimePicker,
  ActionSheet,
  AddressList,
  Empty,
  AddressEdit,
  Icon,
  Search,
  Swipe,
  SwipeItem,
  Loading,
  PullRefresh,
  List,
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Tag,
  Stepper,
  Checkbox,
  SubmitBar,
  Tabs,
  Tab,
  Sidebar,
  SidebarItem
]

const WotComponents = {
  // install 是一个方法，当外界use 这个组件的时候：就会调用本身的install 方法； 同时传vue 这个类方法；

  install: function (Vue) {
    VantList.forEach((item) => {
      Vue.use(item)
    })
  }
}
export default WotComponents
